# # 斐波那契阿数列
#
# class fib:
#     def __init__(self):
#         self.pre = 0
#         self.cou = 1
#
#
#     def __next__(self):
#
#         self.cou, self.pre = self.pre + self.cou, self.cou
#         print(self.cou)
#
#
# if __name__ == '__main__':
#
#     f = fib()
#     i = 0
#     n=int(input("请输入你要获得的个数："))
#     while True:
#         if i == 0:
#             print(i+1)
#         # print(i)
#         f.__next__()
#
#         if i== n-1:
#             break
#         i += 1

#自定义异常类  -- 继承exception
from string import *


class Typeerror1(Exception):
    def __init__(self,str):
        self.str = str
    def string1(self):
        print("你输入的不是全字母！")

str = "hhohs1"
t =Typeerror1(str)
try:
    if str.isalpha():

        raise Typeerror1
except Typeerror1 as wang:
    print(wang)
    t.string1()
